function setTime(datetime) {
  if (!datetime) {
    return "刚刚";
  }
  const arr = datetime.split("T");
  const date = new Date(datetime);
  const curDate = Date.now();
  const h = (curDate - date) / 1000 / 60 / 60;
  if (h < 1) {
    return (h * 60).toFixed(0) + "分钟前";
  } else if (h < 24) {
    return h.toFixed(0) + "小时前";
  } else {
    return arr[0] + " " + arr[1].split(".")[0];
  }
}
export { setTime };
